@extends('admin.layout.global')

@section('css-plugins')
    <link href="{{ asset('style/plugins/bootstrap-switch/css/bootstrap3/bootstrap-switch.min.css') }}" rel="stylesheet">
    <link href="{{ asset('style/plugins/chosen_v1.2.0/chosen.min.css') }}" rel="stylesheet">
@endsection

@section('css')
    <link href="{{ asset('style/admin/css/custom.css') }}" rel="stylesheet">
@endsection

@section('js-plugins')
    <script src="{{ asset('style/plugins/bootstrap-switch/js/bootstrap-switch.min.js') }}"></script>
    <script src="{{ asset('style/plugins/chosen_v1.2.0/chosen.jquery.min.js') }}"></script>
@endsection

@section('js')
    <script src="{{ asset('style/admin/js/pages/blankon.form.element.js') }}"></script>
    <script>
        $(function(){
            $("[type='checkbox']").bootstrapSwitch();
        });
    </script>
@endsection

@section('content')
    <div class="body-content animated fadeIn">
        <div class="row">
            <div class="col-md-4">
                <div class="panel rounded shadow" id="leftMove">
                    <div class="panel-heading">
                        <div class="pull-left">
                            <h3 class="panel-title">{{ last($HMENU)->name }}</h3>
                        </div><!-- /.pull-left -->
                        <div class="pull-right">
                        </div><!-- /.pull-right -->
                        <div class="clearfix"></div>
                    </div><!-- /.panel-heading -->
                    <div class="panel-body">
                        <form method="post">
                            <div class="form-body">
                                {!! csrf_field() !!}
                                <div class="form-group">
                                    <label class="control-label">{{ getLang('fieldsMember', 'group') }}<span class="asterisk">*</span></label>
                                    <select data-placeholder="{{ getLang('fieldsMember', 'groupHelp') }}" name="groupID" class="chosen-select mb-15" tabindex="2">
                                        <option value=""></option>
                                        <optgroup label="{{ getLang('fieldsMember', 'member') }}">
                                            @foreach($memberGroup as $v)
                                                <option value="{{ 'member-'.$v->id }}" @if(old('groupID') && old('groupID') == 'member-'.$v->id) selected @endif>{{ $v->name }}</option>
                                            @endforeach
                                        </optgroup>
                                    </select>
                                    {!! getErrorMsg($errors, 'groupID') !!}
                                </div>
                                <div class="form-group">
                                    <label class="control-label">{{ getLang('fieldsMember', 'username') }}<span class="asterisk">*</span></label>
                                    <input placeholder="{{ getLang('fieldsMember', 'usernameHelp') }}" name="name" value="{{ old('name') }}" class="form-control" type="text">
                                    {!! getErrorMsg($errors, 'name') !!}
                                </div>
                                <div class="form-group">
                                    <label class="control-label">{{ getLang('fieldsMember', 'nickname') }}</label>
                                    <input placeholder="" name="realName" value="{{ old('realName') }}" class="form-control" type="text">
                                </div>
                                <div class="form-group">
                                    <label class="control-label">{{ getLang('fieldsMember', 'email') }}</label>
                                    <input placeholder="{{ getLang('fieldsMember', 'emailHelp') }}" name="email" value="{{ old('email') }}" class="form-control" type="email">
                                    {!! getErrorMsg($errors, 'email') !!}
                                </div>
                                <div class="form-group">
                                    <label class="control-label">{{ getLang('fieldsMember', 'phone') }}</label>
                                    <input placeholder="{{ getLang('fieldsMember', 'phoneHelp') }}" name="phone" value="{{ old('phone') }}" class="form-control" type="text">
                                </div>
                                <div class="form-group">
                                    <label class="control-label">{{ getLang('fieldsMember', 'password') }}<span class="asterisk">*</span></label>
                                    <input placeholder="" name="password" value="" class="form-control" type="password">
                                    {!! getErrorMsg($errors, 'password') !!}
                                </div>
                                <div class="form-group">
                                    <label class="control-label">{{ getLang('fieldsMember', 'password2') }}<span class="asterisk">*</span></label>
                                    <input placeholder="" name="password_confirmation" value="" class="form-control" type="password">
                                </div>
                                <div class="row">
                                    <div class="col-md-6">
                                        <a href="{{ action('Admin\MemberController@getIndex') }}" class="btn btn-warning btn-sm btn-block"><i class="fa fa-reply"></i> <span class="bold">{{ getLang('Tips', 'rollBack') }}</span></a>
                                    </div>
                                    <div class="col-md-6">
                                        <button class="btn btn-primary btn-sm btn-block" type="submit"><i class="fa fa-check"></i>&nbsp;{{ getLang('Tips', 'submit') }}</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div><!-- /.panel-body -->
                </div><!-- /.panel -->
            </div>
        </div><!-- /.row -->
    </div>
@endsection